<div id="rooms">
  共有  <b><%=@event.rooms.size.to_s%></b>  套
  <%=link_to_remote '[点击查看详情]',:update=>"show_rooms",:url=>{:controller=>"events",:action=>"query_rooms",:id=>"#{@event.id}"},:complete=>"jQuery('#show_rooms').show('fold')"%>房间;
  已有  <b id="checked_in"><%=@event.checked_in.size%></b>  人入住，尚有  <b id="unchecked_in"><%=@event.unchecked_in.size%></b>  人没有入住
  <p/><br/>
  <br/>
  <%@room_groups.each do |room_group|%>
    <br/><li> <b><%=room_group.room_category%></b>
    间:
    <b><%=room_group.count%></b>
    套<%=link_to_remote '[点击查看详情]',:update=>"show_rooms",:url=>{:controller=>"events",:action=>"query_rooms",:id=>"#{@event.id},#{room_group.room_category}"},:complete=>"jQuery('#show_rooms').show('fold')"%>,
    其中已有  <b><%=@room_hash[room_group.room_category]["allocation"].size%></b>  套已被分配,
    尚有  <b><%=@room_hash[room_group.room_category]["unallocation"].size%></b>  套未被分配.
    <a href="#" onclick="Element.toggle('room_<%=room_group.room_category%>_allocation');return false">分配房间</a>
    </li>
    <div id="room_<%=room_group.room_category%>_allocation" style='display:none'>
      <%remote_form_for :room,:url=>{:controller=>'rooms',:action=>'pre_allocation',:event_id=>"#{@event.id}"} do |f|%>
      <%=hidden_field_tag 'room_category',room_group.room_category%>
      如果每个房间住<%= f.select(:count,%w{1 2 3}) %>人,
      假设将其分配给
      <%= f.select(:start_level,Level::OPTIONS) %>
      和
      <%= f.select(:end_level,Level::OPTIONS) %>
      级别之间的人,
      <%= f.submit '那么' %>
      <%end%>
    <span id="room_<%=room_group.room_category%>_place"></span>

    </div>
    
    <br/>
  <%end%>
  <br/>
  <div id="show_rooms">
    <%=render :partial=>'room_list',:locals=>{:rooms=>@rooms}%>
  </div>
  <br/>
  <hr/>
  <br/>
  <div style="float:right">
    <a href="#" onclick="Element.toggle('new_room_form');return false">添加房间</a>  |
    <%=link_to "返回",event_path(:id=>@event.id)%>
  </div>
  <br />
  <div id="new_room_form" style='display:none'>
    <%remote_form_for :room,:url=>{:controller=>'rooms',:action=>'create'},:html=>{:id=>'room_form'} do |f|%>
        <div id="errors" style="display:none">
        </div>
        <br/>
        <%=hidden_field_tag 'event',params[:event_id]%>
        <div class="fields text_fields">
          <%= f.label :name,'房间号:' %><%= f.text_field :name %><br clear="all"/>
        </div>
        <div class="fields text_fields">
          <%= f.label :tel,'电话:' %><%= f.text_field :tel %><br clear="all"/>
        </div>
        <div class="fields select_fields">
          <%= f.label :room_category,'类型:' %><%=f.select :room_category,%w{单人间 标准间 豪华间 商务间 行政间 套间 双套间 组合套间 多套间 高级套间 复式套间}%><br clear="all"/>
        </div>
        <div class="buttons">
        <div class="lt_button">
          <%= f.submit '保存房间信息',:class=>'submit'%>
        </div>
      </div>
    <%end%>
  </div>
</div>